#version python 3
#quicksort
def quicksort(array):
    if len(array) < 2:
        return array
    else:           
        pot = array[0]
        less=[i for i in array[1:] if i <= pot]
        print(less)
                
        high=[i for i in array[1:] if i > pot]
        print(high)
               
        return str(quicksort(less))+str([pot])+str(quicksort(high))

if __name__ == "__main__":
    a = [3,2,7,12,1]
    print(quicksort(a))